package com.demo.afternoon;

import java.util.ArrayList;

/**
 * @ClassName 工具类
 * @Description TODO
 * @Author tianqinglong
 * @Date 17:26 2022/7/5
 * @Version 1.0
 **/
public class 工具类 {
    public static void main(String[] args) {
        StringTool.change("aA12");
    }
}
class StringTool{
    public static String change(String str){
        char[] chars = str.toCharArray();
        ArrayList<Object> objects = new ArrayList<>();
//        System.out.println(chars);
        for (int i = 0; i < chars.length; i++) {
            if(chars[i]>'a'&&chars[i]<'z'){
                chars[i]-=32;
                objects.add(chars[i]);
            }
            if (chars[i]<'A'&&chars[i]>'Z'){
                chars[i]+=32;
                objects.add(chars[i]);
            }
        }
        for (int i = 0; i < objects.size(); i++) {
            System.out.println(objects.get(i));
        }
            return objects.toString();
    }
}
